package com.ruoyi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum BUserType {

    //用户类型：0-患者，1-医生，2-医教
    Patient("0","患者"),
    Doctor("1","医生"),
    Teacher("2","患教");

    private String value;
    private String name;

    public static BUserType valuesOf(String value) {
        //获取所有枚举集合
        BUserType[] es = values();
        for (BUserType e : es) {
            if (Objects.equals(e.getValue(), value)) {
                return e;
            }
        }
        return null;
    }
}
